package main

import (
	"seat-service/initialization"
	"seat-service/router"
	"seat-service/utils/global"
	"seat-service/work"
)

func main() {
	//初始化viper
	initialization.InitViper()
	//初始化zap
	initialization.InitZap()
	//初始化mysql
	initialization.InitMysql()
	//初始化redis
	initialization.InitRedis()
	//初始化数据表
	initialization.CreateTable()
	//初始化redis
	initialization.CreateRedis()
	//初始化雪花算法
	initialization.InitSnowFlake()
	//加载字典数据到内存中
	global.LoadDic()

	//初始化协程池
	//pool := utils.NewPool(40000, 1, 20000)
	//defer pool.Wait()

	//开启定时任务，获取微信小程序推送的token
	go work.Task()

	//运行 队列,定时任务
	work.Use()

	//学生预约处理
	//go work.PushReserve(pool)

	router.Router()
}
